<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>意见反馈</title>
    <link rel="stylesheet" href="css/main.css" />
    <link rel="stylesheet" href="iconfont/iconfont.css" />
    <style>
    	/*头部*/
    	body{
    		width:100%;
    		height:100%;
    		background:#f5f5f5;
    	}
header{
	width:100%;
	height:1.28rem;
	padding-top:0.4rem!important;
	background: #FF7630;
	-webkit-box-sizing:border-box;
    padding:0  0.44rem;
    line-height: 0.88rem;
    display: flex;	
    justify-content: space-between;
    align-items:center;
    position:relative;
}
.icon-fanhui{
	position:absolute;
	top:calc(50% + 0.2rem);
	left:0.25rem;
	-webkit-transform: translateY(-50%);
	color:#fff;
}
/*content开始 */
.content{
    width:100%;
    height:4rem;
	margin-top:0.16rem;
	background: #fff;
}
::-webkit-input-placeholder{
	font-size:0.28rem;
    color:rgba(153,153,153,1);
}
textarea{
	width:100%;
	height:100%;
	border:none;
	padding:0.24rem;
	background:#fff;
	outline:none;
	resize: none;
}
.notice{
	height:0.8rem;
	padding:0 0.5rem;
	font-size:0.3rem;
	border-radius: 0.08rem;
	color:#fff;
	position:fixed;
	top:50%;
	left:50%;
	-webkit-transform: translate(-50%);
	display: flex;
	align-items: center;
	background: rgba(0,0,0,0.2);
	display: none;
}
    </style>
</head>
<body>
	<!--提示框-->
	<div class="notice"></div>
    <!--header开始-->   
      <header>
      	<div class="iconfont icon-fanhui mui-action-back"></div>
      	<div style="font-size:0.28rem;opacity: 0;">返回</div>
      	<div style="font-size:0.34rem;color:#fff;">意见反馈 </div>
      	<div style="font-size:0.28rem;color:#fff;" class="submit">提交</div>
      </header>
    <!--header结束-->
    <!--表单的开始-->
     <section class="content">
     	 <textarea name="feedback" rows="" cols="" placeholder="留下您的宝贵意见，我会越变越好" maxlength="300"></textarea>
     </section>
    <!--表单的结束-->
</body>
<script src="js/mui.js"></script>
<script type="text/javascript" src="js/pxtorem.js"></script>
<script src="js/apptool.js"></script>
<script>
	mui.init({
  preloadPages:[{
    url:'feedbackok.html',        
    id:'feedbackok',
  }]
});
mui.plusReady(function(){
	webtool.newback();
	mui('.submit')[0].addEventListener('tap',function(){
	var opinion=mui('textarea')[0].value;
	if(!opinion){
		mui('.notice')[0].innerText="提交的内容不能为空";
		mui('.notice')[0].style.display="flex";
		setTimeout(function(){
			mui('.notice')[0].style.display="none";
		},500);
	}else{
//			mui.ajax('',{
//				data:{
//					feedback:mui('textarea')[0].value,
//				},
//				dataType:'json',
//				type:'post',
//				headers:{'Content-Type':'application/json'},
//				success:function(data){
//					data=JSON.stringify(data);
//					console.log(data);
//				},
//				error:function(xhr,type,errorThrown){
//				//异常处理；
//				console.log(xhr)
//			  }
//			})
		var feedbackokPage=null;
		if(!feedbackokPage){
			feedbackokPage = plus.webview.create('feedbackok.html','feedbackok');
		}else{
		    feedbackokPage=plus.webview.getWebviewById('feedbackok');
		}
		 mui.fire(feedbackokPage,'feedbackid',{
	           feedbackid:plus.webview.currentWebview().id,
	     })
		 feedbackokPage.show('fade-in',300);
		}
	  })
})


</script>
</html>